<div class="am-u-sm-12">
    <form class="am-form" id="list-form" action="${base}/transactionLog/list" method="post">
        <input type="hidden" id="keywords" name="keywords" value='${keywords!""}'/>
        <table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
            <tbody>
            <tr>
                <th class="am-text-middle">接口名称</th>
                <td>
                    <div class="am-u-sm-10">
                        <select data-am-selected="{btnSize:'sm',maxHeight: 200,btnWidth: 200,searchBox: 1}" id="api_option">
                            <option value="-1">全部</option>
                            <%for(option in api_options){%>
                            <option value="${option.api}" <%if(option.api==api!""){%>
                            selected
                            <%}%>>${option.api}</option>
                            <%}%>
                        </select>
                    </div>
                </td>
                <th class="am-text-middle">日期</th>
                <td>
                    <div class="am-u-sm-4">
                        <div class="am-form am-form-inline">
                            <div class="am-form-group am-form-icon">
                                <i class="am-icon-calendar"></i>
                                <input type="text" value="${opt_time!}" class="am-form-field  am-input-sm" placeholder="日期" readonly id="opt_time"/>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-8">
                        <span style="color: red;margin-top:100px">默认展示前一天的数据统计</span>
                    </div>
                </td>
            </tr>

            <tr>
                <td colspan="4">
                    <div align='right'>

                        <button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary" id="submit-btn"
                                onClick="submit_btn('search');">搜索
                        </button>
                        <button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary" id="export-btn"
                                onClick="submit_btn('export');">导出
                        </button>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>

<script>
    $(function() {
        var nowTemp = new Date();
        var nowDay = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0).valueOf();
        var nowMoth = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), 1, 0, 0, 0, 0).valueOf();
        var nowYear = new Date(nowTemp.getFullYear(), 0, 1, 0, 0, 0, 0).valueOf();
        var $opt_time = $('#opt_time');

        var checkin = $opt_time.datepicker({
            onRender: function(date, viewMode) {
                // 默认 days 视图，与当前日期比较
                var viewDate = nowDay;
                switch (viewMode) {
                        // moths 视图，与当前月份比较
                    case 1:
                        viewDate = nowMoth;
                        break;
                        // years 视图，与当前年份比较
                    case 2:
                        viewDate = nowYear;
                        break;
                }
                return date.valueOf() >= viewDate ? 'am-disabled' : '';
            }
        }).on('changeDate.datepicker.amui', function(ev) {
            checkin.close();
        }).data('amui.datepicker');
    });
</script>